package com.example.psychologicalappointmentsystem.JpaRepository;

import com.example.psychologicalappointmentsystem.Entity.User;
import com.example.psychologicalappointmentsystem.Enum.UserRole;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface UserRepository extends JpaRepository<User, Long> {

    User findByUsername(String username);

    boolean existsByUsername(String username);

    User findByToken(String token);

    Page<User> findByRole(UserRole RoleName, Pageable pageable);


}
